package com.haha.http.rpc.example.server.service.impl;

import com.haha.http.rpc.example.api.pojo.Student;
import com.haha.http.rpc.example.api.service.StudentService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangxiaofan07
 * @version 1.0 2022/2/10
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Override
    public Student getStudent(String name, int age) {
        Student student = new Student();
        student.setAge(age);
        student.setName(name);
        return student;
    }

    @Override
    public List<Student> getStudentList() {
        List<Student> list = new ArrayList<>();

        Student student = new Student();
        student.setAge(18);
        student.setName("xiaoming");
        list.add(student);

        Student student1 = new Student();
        student1.setAge(17);
        student1.setName("xianghong");
        list.add(student1);

        return list;
    }
}
